﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BillInfoControl.ascx.cs" Inherits="User_Controls_BillInfoControl" %>
<%@ Import Namespace="Active.Core.State" %>
<h2>广告清单</h2>
<asp:FormView ID="BillFormView" DataSourceID="BillDataSource" runat="server">
<ItemTemplate>
<ul>
    <li>
    <asp:Label ID="Label1" runat="server" Text="查看: "></asp:Label>
    <asp:HyperLink ID="HyperLink6" 
        NavigateUrl='<%# Eval("Id", "~/BalanceTable.aspx?id={0}") %>' runat="server"
        Enabled='<%# !Page.Request.RawUrl.Contains("BalanceTable.aspx") %>'>收支表</asp:HyperLink>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:HyperLink ID="HyperLink5" NavigateUrl='<%# Eval("Id", "~/Bill/Bill.aspx?id={0}") %>' 
        Enabled='<%# !Page.Request.RawUrl.Contains("Bill.aspx") %>'
        runat="server">详细信息</asp:HyperLink>
    </li>
    <li>
    <asp:Label ID="Label3" runat="server" Text="客户: "></asp:Label>
    <asp:HyperLink ID="HyperLink2" NavigateUrl='<%# Eval("CustomerId", "~/Customer/Customer.aspx?id={0}") %>' 
        runat="server"><%# Eval("CustomerName") %></asp:HyperLink>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="Label4" runat="server" Text="产品: "></asp:Label>
    <asp:HyperLink ID="HyperLink3" NavigateUrl='<%# Eval("CustomerId", "~/Customer/Customer.aspx?id={0}") %>' 
        runat="server"><%# Eval("ProductName") %></asp:HyperLink>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="Label2" runat="server" Text="代理:" 
        Visible='<%# Eval("Agent")!=null %>'></asp:Label>
    <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# Eval("AgentId", "~/Customer/Agent.aspx?id={0}") %>' 
        Visible='<%# Eval("Agent")!=null %>' runat="server"><%# Eval("AgentName") %></asp:HyperLink>
    </li>
    <li>
    <asp:Label ID="Label8" runat="server" Text="编号:"></asp:Label>
    <asp:Label ID="Label12" runat="server" Text='<%# Eval("Number") %>'></asp:Label>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="Label7" runat="server" Text="开始日期:"></asp:Label>
    <asp:Label ID="Label9" runat="server" Text='<%# Eval("StartDate", "{0:yyyy-M-d}")  %>'></asp:Label>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="Label10" runat="server" Text="结束日期:"></asp:Label>
    <asp:Label ID="Label11" runat="server" 
        Text='<%# ((Csla.SmartDate)Eval("EndDate")).IsEmpty ? "未定" : Eval("EndDate", "{0:yyyy-M-d}")  %>'>
    </asp:Label>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="Label13" runat="server" Text="工作状态:"></asp:Label>
    <span class="state"><%# Formater.GetStateText(Eval("StateValue")) %></span>
    </li>
</ul>
</ItemTemplate>
</asp:FormView>
<csla:CslaDataSource ID="BillDataSource" runat="server" 
    TypeName="Active.Core.Bill, Active.Core"
    TypeSupportsPaging="False" TypeSupportsSorting="False" 
    OnSelectObject="BillDataSource_SelectObject">
</csla:CslaDataSource>
<asp:PlaceHolder ID="phOperations" runat="server">
<h2>确认操作</h2>
<p><asp:Button ID="btnSubmitBill" runat="server" Text="提 交" OnClientClick="return confirm('确定要提交吗?')" OnClick="btnSubmitBill_Click" /></p>
<p><asp:Button ID="btnCancelConfirmBill" runat="server" Text="退 回" OnClientClick="return confirm('确定要退回吗?')" OnClick="btnCancelConfirmBill_Click" /></p>
</asp:PlaceHolder>